package com.pengtu.gsj.entity.yh;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.pengtu.gsj.entity.app.Attachment;
import com.pengtu.gsj.entity.base.IdEntity;

/**
 * 
 * 路段整改信息实体
 * RoadRectification
 * 
 * 2017年7月31日 上午11:17:46
 * @author zl
 * @version 1.0.0
 *
 */
@Entity
@Table(name = "T_YH_ROADRECTIFICATION")
public class RoadRectification extends IdEntity {
	
	/**
	 * serialVersionUID:TODO
	 *
	 * @since 1.0.0
	 */
	
	private static final long serialVersionUID = 2545089269003336504L;
 
	public String year;   //整改年份
	
	public double ministerial; //部级督办
	
	public double provincial;  //省级督办
	
	public double rectification; //已整改
	
	public double rectificationRate; //整改率
	
	public String remark; //备注
	
	private Integer bulletinNumber;   //文件数
	
	private List<Attachment> attachments;

	@Column(name = "YEAR")
	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	@Column(name = "MINISTERIAL")
	public double getMinisterial() {
		return ministerial;
	}

	public void setMinisterial(double ministerial) {
		this.ministerial = ministerial;
	}

	@Column(name = "PROVINCIAL")
	public double getProvincial() {
		return provincial;
	}

	public void setProvincial(double provincial) {
		this.provincial = provincial;
	}

	@Column(name = "RECTIFICATION")
	public double getRectification() {
		return rectification;
	}

	public void setRectification(double rectification) {
		this.rectification = rectification;
	}

	@Column(name = "RECTIFICATIONRATE")
	public double getRectificationRate() {
		return rectificationRate;
	}

	public void setRectificationRate(double rectificationRate) {
		this.rectificationRate = rectificationRate;
	}

	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Transient
	public Integer getBulletinNumber() {
		bulletinNumber = attachments.size();
		return bulletinNumber;
	}

	public void setBulletinNumber(Integer bulletinNumber) {
		this.bulletinNumber = bulletinNumber;
	}
	
	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name = "PARTID")
	public List<Attachment> getAttachments() {
		return attachments;
	}

	public void setAttachments(List<Attachment> attachments) {
		this.attachments = attachments;
	}
	
	
}
